<template>
	<view>

		<!-- 公告信息 -->
		<!--		<swiper :indicator-dots="true" :autoplay="true" :interval="3000" :duration="1000">-->

		<!--&lt;!&ndash;			<swiper-item v-for="(item, i) in swiperList" :key="i">&ndash;&gt;-->
		<!--&lt;!&ndash;				<navigator class="swiper-item" :url="'/subpkg/info_detil/info_detil?id=' + item.id">&ndash;&gt;-->
		<!--&lt;!&ndash;					{{item.name}}&ndash;&gt;-->
		<!--&lt;!&ndash;				</navigator>&ndash;&gt;-->
		<!--&lt;!&ndash;			</swiper-item>&ndash;&gt;-->

		<swiper :indicator-dots="true" :autoplay="true" :interval="3000" :duration="1000">
			<swiper-item>
				<image src="../../static/16.jpg"></image>
			</swiper-item>
			<swiper-item>
				<image src="../../static/19.jpg"></image>
			</swiper-item>
			<swiper-item>
				<image src="../../static/asd8.jpg"></image>
			</swiper-item>
		</swiper>
	<!-- 分割线 -->
<u-divider
        text="......................................................................................"
        textColor="#2979ff"
        lineColor="#000000"
></u-divider>
		<div></div>
		<!-- 搜索 -->
		<u-search placeholder="日照香炉生紫烟" v-model="keyword"></u-search>
<!-- 分割线 -->
<u-divider
        text="......................................................................................"
        textColor="#2979ff"
        lineColor="#000000"
></u-divider>
		<!-- 菜单 -->
		<view>
			<u-grid :border="false" @click="click">
				<u-grid-item v-for="(baseListItem,baseListIndex) in baseList" :key="baseListIndex">
					<u-icon :customStyle="{paddingTop:20+'rpx'}" :name="baseListItem.name" :size="22"></u-icon>
					<text class="grid-text">{{baseListItem.title}}</text>
				</u-grid-item>
		 </u-grid>
			<u-toast ref="uToast" />
		</view>



		

		<view class="nav-list">
			<!-- <view class="nav-item" v-for="(item, i)in menuList" :key="i" @click="navMenu(item)">
			
		</view> -->

		</view>


		<!-- 其他数据 -->
		<view class="nav-list">
			<!-- <view class="nav-item" v-for="(item, i)in menuList" :key="i" @click="navMenu(item)">
			
		</view> -->
			<text>其他数据</text>


		</view>


		<!-- 左侧大图片 右侧四个小图片 -->
		<view class="imgbox">
			<!-- 图片区域 -->
			<!-- 左图大盒子 -->
			<view class="left-box"></view>
			<!-- 右侧4个小图片 -->
			<view class="right-box">
				<!-- <view class="nav-item" v-for="(item, i)in right" :key="i" >
					
				</view> -->
			</view>

		</view>


	</view>
</template>

<script>
	import UImage from "../../uni_modules/uview-ui/components/u--image/u--image";
	export default {
		components: {
			UImage
		},
		data() {
			return {
				baseList: [{
						name: 'account',
						title: '我的'
					},
					{
						name: 'home',
						title: '房屋'
					},
					{
						name: 'phone',
						title: '报修'
					},
					{
						name: 'man-add',
						title: '申报居住人数'
					},
					{
						name: 'lock',
						title: '车位'
					},
					{
						name: 'car',
						title: '车辆'
					},
				],

				//轮播图公告数据
				swiperList: [],
				//菜单导航
				menuList: [],
				//其他数据
				ortherList: []

			};
		},
		onLoad() {
			this.$axios.post("/api/v1/yz/parkinfo").then((r) => {
				console.log(r)
				})
			
		
			
			//调用方法
			this.getSwiperList(),
				this.getMenuList(),
				this.getOrtherList()

		},
		methods: {
			click(name) {
			                //this.$refs.uToast.success(`点击了第${name}个`)
							if(name==0){
								this.$refs.uToast.success(`点击了第${name}个`)
								uni.navigateTo({
									url:'/pages/yeIndex/mine'
								})
							}else if(name==1){
								uni.navigateTo({
									url:'/pages/yeIndex/room'
								})
							}else if(name==2){
								uni.navigateTo({
									url:'/pages/repairs/repairsRecord'
								})
							}else if(name==3){
								uni.navigateTo({
									url:'/pages/yeIndex/roomPeople'
								})
							}else if(name==4){
								uni.navigateTo({
									url:'/pages/yeIndex/carweizhi'
								})
							}else if(name==5){
								uni.navigateTo({
									url:'/pages/yeIndex/car'
								})
							}
							
			            },

			getSwiperList() {
				console.log("swiper")
				// uni.request({
				// 	url: 'http://localhost:8088/api/v1/bx/place/list',
				// 	method: 'POST',
				// 	success: (res) => {
				// 		console.log(res.data.data)
				// 		this.swiperList = res.data.data
				// 		uni.$showMsg("sussce")
				// 	},
				// 	fail: (res) => {
				// 		uni.$showMsg()
				// 	}
				// })

			},
			getMenuList() {
				console.log("menu")
				// uri.request({
				// 	url: '',
				// 	method: 'POST',
				// 	success: (res) => {
				// 	}
				// })
			},
			navMenu(item) {
				console.log(item)
				// if (item.name == "XX") {
				// 	uri.switchTab({
				// 		url: '/pages/cate/cate'
				// 	})
				// }
			},
			//待定数据
			getOrtherList() {
				// if (item.name == "XX") {
				// 	uri.switchTab({
				// 		url: '/pages/cate/cate'
				// 	})
				// }
			}
		}
	}
</script>

<style lang="scss">
	.grid-text {
		font-size: 14px;
		color: #909399;
		padding: 10rpx 0 20rpx 0rpx;
		/* #ifndef APP-PLUS */
		box-sizing: border-box;
		/* #endif */
		border: 1px;
	}

	swiper {
		height: 330rpx;

		.swiper-item,
		image {
			width: 100%;
			height: 100%;
		}

		.nav-list {


			display: flex;


		}
	}

	.right-box {
		display: flex;
		flex-wrap: wrap;
	}

	.imgbox {
		display: flex;
		padding: 10rpx;
	}
</style>
